package com.zb.feigns.fallback;

import com.zb.feigns.ArticleFeign;
import com.zb.model.common.Result;
import com.zb.model.pojo.article.ApAuthor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class ArticleFeignFallback implements FallbackFactory<ArticleFeign> {
    @Override
    public ArticleFeign create(Throwable throwable) {
        return new ArticleFeign() {
            @Override
            public Result<ApAuthor> findByUserId(Integer userId) {
                return Result.FAIL();
            }
            @Override
            public Result save(ApAuthor apAuthor) {
                return Result.FAIL();
            }
        };
    }
}
